package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author: 徐波
 * @creat: 2017/11/23 0023 15:33
 * description:
 */
@Entity
@Table(name = "T_SYS_DEPART", schema = "oa", catalog = "")
public class DepartEntity extends BaseEntity {
    private String name;
    private Integer sortNo;
    private String companyId;
    private String createUserId;
    private String updateUserId;
    private String level;
    private String parentId;
    private String type;
    private String wechatId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getWechatId() {
        return wechatId;
    }

    public void setWechatId(String wechatId) {
        this.wechatId = wechatId;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("ID", this.getId());
        json.put("NAME", this.getName());
        json.put("SORT_NO", this.getSortNo());
        json.put("DEL_FLAG", this.getDelFlag());
        json.put("COMPANY_ID", this.getCompanyId());
        json.put("CREATE_TIME", this.getCreateTime());
        json.put("CREATE_USER_ID", this.getCreateUserId());
        json.put("UPDATE_USER_ID", this.getUpdateUserId());
        json.put("UPDATE_TIME", this.getUpdateTime());
        json.put("LEVEL", this.getLevel());
        json.put("PARENT_ID", this.getParentId());
        json.put("TYPE", this.getType());
        json.put("WECHAT_ID", this.getWechatId());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_DEPART";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("ID", "id");
        json.put("NAME", "name");
        json.put("SORT_NO", "sortNo");
        json.put("DEL_FLAG", "delFlag");
        json.put("COMPANY_ID", "companyId");
        json.put("CREATE_TIME", "createTime");
        json.put("CREATE_USER_ID", "createUserId");
        json.put("UPDATE_USER_ID", "updateUserId");
        json.put("UPDATE_TIME", "updateTime");
        json.put("LEVEL", "level");
        json.put("PARENT_ID", "parentId");
        json.put("TYPE", "type");
        json.put("WECHAT_ID", "wechatId");
        return json;
    }
}
